package com.rockbb.common.sso.session;

import java.io.Serializable;
import java.util.Date;

import org.codehaus.jackson.map.annotate.JsonView;

import com.rockbb.common.utilities.text.JacksonViews;

public class SessionUser implements Serializable 
{

	private static final long serialVersionUID = 329206067661215452L;
	private long id;
	private long uid;
	private String name;
	private String cleanname;
	private String password;
	private String email;
	private int language;
	private float timezone;
	private int style;
	private String permissions;
	private Date createtime;
	private int status;
	private String activation_code;
	private Date activation_time;

	public long getId()
	{
		return id;
	}

	public void setId(long id)
	{
		this.id = id;
	}

	@JsonView(JacksonViews.Public.class)
	public long getUid()
	{
		return uid;
	}
	public void setUid(long uid)
	{
		this.uid = uid;
	}

	@JsonView(JacksonViews.Public.class)
	public String getName()
	{
		return name;
	}
	public void setName(String name)
	{
		this.name = name;
	}

	@JsonView(JacksonViews.Public.class)
	public String getCleanname()
	{
		return cleanname;
	}
	public void setCleanname(String cleanname)
	{
		this.cleanname = cleanname;
	}

	@JsonView(JacksonViews.Internal.class)
	public String getPassword()
	{
		return password;
	}
	public void setPassword(String password)
	{
		this.password = password;
	}

	@JsonView(JacksonViews.Public.class)
	public String getEmail()
	{
		return email;
	}
	public void setEmail(String email)
	{
		this.email = email;
	}

	@JsonView(JacksonViews.Public.class)
	public int getLanguage()
	{
		return language;
	}
	public void setLanguage(int language)
	{
		this.language = language;
	}

	@JsonView(JacksonViews.Public.class)
	public float getTimezone()
	{
		return timezone;
	}
	public void setTimezone(float timezone)
	{
		this.timezone = timezone;
	}

	@JsonView(JacksonViews.Public.class)
	public int getStyle()
	{
		return style;
	}
	public void setStyle(int style)
	{
		this.style = style;
	}

	@JsonView(JacksonViews.Public.class)
	public String getPermissions()
	{
		return permissions;
	}
	public void setPermissions(String permissions)
	{
		this.permissions = permissions;
	}

	@JsonView(JacksonViews.Internal.class)
	public Date getCreatetime()
	{
		return createtime;
	}
	public void setCreatetime(Date createtime)
	{
		this.createtime = createtime;
	}

	@JsonView(JacksonViews.Public.class)
	public int getStatus()
	{
		return status;
	}
	public void setStatus(int status)
	{
		this.status = status;
	}

	@JsonView(JacksonViews.Internal.class)
	public String getActivation_code()
	{
		return activation_code;
	}
	public void setActivation_code(String activation_code)
	{
		this.activation_code = activation_code;
	}

	@JsonView(JacksonViews.Internal.class)
	public Date getActivation_time()
	{
		return activation_time;
	}
	public void setActivation_time(Date activation_time)
	{
		this.activation_time = activation_time;
	}

	public static SessionUser getAnonymousUser() {
		SessionUser user = new SessionUser();
		user.id = SessionConstants.USER_ID_ANONYMOUS;
		user.uid = SessionConstants.USER_UID_ANONYMOUS;
		user.name = "";
		user.cleanname = "";
		user.password = "";
		user.email = "";
		user.language = 0;
		user.timezone = 8.0F;
		user.style = 0;
		user.permissions = "";
		return user;
	}
}
